import Taro, {Component, Config} from '@tarojs/taro'
import { ScrollView, View } from '@tarojs/components'
import './index.scss'
import { showEmpty } from "@/utils/utils"
import { LoadMore, TabList, EmptyData } from '@/components/index'

export default class Index extends Component {
  state: any
  props: any
  config: Config = {
    navigationBarTitleText: '我的收藏'
  }

  constructor () {
    super(...arguments)
    this.state = {
      page: 1,
      limit: 10,
      dataList: [],
      loadStatus: 'loading',
    }
  }

  render() {
    const { dataList, loadStatus } = this.state
    const tabList = [{ title: '收藏的店铺' }, { title: '收藏的文章' }]
    return (
      <View className='page'>
        <TabList list={tabList} current={0}/>
        <ScrollView className='favorite-scroll'>
          <View className='data-list'>

          </View>
          {!showEmpty(dataList, loadStatus) && <LoadMore status={loadStatus}/>}
          {showEmpty(dataList, loadStatus) && <View className='list-empty h-p-100'><EmptyData/></View>}
        </ScrollView>
      </View>
    )
  }
}
